package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class WindowFunction implements NonparenthesizedValueExpressionPrimary {

    private int beginIndex;
    private int endIndex;
    private WindowFunctionType windowFunctionType;
    private WindowNameOrSpecification windowNameOrSpecification;

    public WindowFunction(WindowFunctionType windowFunctionType,
                          WindowNameOrSpecification windowNameOrSpecification) {
        this.beginIndex = windowFunctionType.getBeginIndex();
        this.endIndex = windowNameOrSpecification.getEndIndex();
        this.windowFunctionType = windowFunctionType;
        this.windowNameOrSpecification = windowNameOrSpecification;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public WindowFunctionType getWindowFunctionType() {
        return windowFunctionType;
    }

    public WindowNameOrSpecification getWindowNameOrSpecification() {
        return windowNameOrSpecification;
    }

}
